﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="ProjectX.Login"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户登录</title>
    <link href="/WebCss/base.css" rel="stylesheet" type="text/css" />
    <link href="/WebCss/regandlog.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/ClientJs/jquery.js"></script>
    <style type="text/css">
        .divbody
        {
            background:url("/Webimg/login.png") no-repeat;  
        }     
        #logindiv
        {
            position:absolute;
            left:35px;
            top:110px;
            width:245px;
            height:175px;
            text-align:left;
        }
        .divtitle
        {
            height:20px;  
            line-height:20px;
            margin-top:10px;     
        }
        #regdiv
        {
            position:absolute;
            top:110px;
            left:318px;
            width:245px;
            height:50px;
        }
        #findpwd
        {
            position:absolute;
            top:240px;
            left:318px;
            width:245px;
            height:50px;
        }  
        input[type="text"],input[type="password"]
        {
            width:237px;
        }  
    </style>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("input:text:first").focus();
            $(document).keydown(function () {
                if (event.keyCode == 13) {
                    $("#regeditbtn").click();
                }
            });
        });
    </script>
</head>
<body>
<div class="divbody">
    <form id="LoginForm" runat="server">
    <div id="logheader" class="header">
        <a href="/" target="_self">[返回首页]</a>
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div id="logindiv">
                <div class="divtitle">
                    <span id="uname">用户名</span>
                    <asp:RequiredFieldValidator ID="usernameValidator" runat="server" 
                        ErrorMessage="请输入用户名" ControlToValidate="username" CssClass="error" 
                        Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="unamecstValidator" runat="server" ErrorMessage="用户不存在" 
                        CssClass="error" Display="Dynamic" ControlToValidate="username" 
                        onservervalidate="unamecstValidator_ServerValidate"></asp:CustomValidator>
                </div>
                <div>
                    <asp:TextBox ID="username" runat="server" CssClass="maintextcss"></asp:TextBox>
                </div>
                <div class="divtitle">
                    <span class="logspan">密&nbsp&nbsp码</span>
                    <asp:RequiredFieldValidator ID="pwdValidator" runat="server" 
                        ErrorMessage="请输入密码" Display="Dynamic" ControlToValidate="pwdtxt" 
                        CssClass="error"></asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="pwdcstValidator" runat="server" ErrorMessage="密码不正确" 
                        ControlToValidate="pwdtxt" CssClass="error" Display="Dynamic" 
                        onservervalidate="pwdcstValidator_ServerValidate"></asp:CustomValidator>
                </div>
                <div>
                    <asp:TextBox ID="pwdtxt" runat="server" TextMode="Password" CssClass="maintextcss"></asp:TextBox>
                </div>
                <div class="divtitle" style="text-align:center;">
                    <asp:ImageButton ID="loginbtn" runat="server" ImageUrl="~/Webimg/loginbtn.png" 
                        onclick="loginBtn_Click" />
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="loginbtn" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
        <div id="regdiv">
            <div style="margin-top:10px;">
                <asp:ImageButton ID="regnew" runat="server" ImageUrl="~/Webimg/regnew.png" 
                    CausesValidation="False" onclick="regnew_Click" />
            </div>
        </div>
        <div id="findpwd">
            <div style="margin-top:10px;">
                <asp:ImageButton ID="getpwd" runat="server" ImageUrl="~/Webimg/getpwd.png" 
                    CausesValidation="False" onclick="getpwd_Click" />
            </div>
        </div>
        <div id="logfoot" class="footer">
            <a>隐私条款</a>
            <a>服务协议</a>
            <a>帮助中心</a>
        </div>
    </form>
</div>
</body>
</html>
